#! /bin/bash

SCRIPT_DIR="$(
    cd "$(dirname "$0")"
    pwd
)"

mac_build="${SCRIPT_DIR}/mac_build"

if [ -d "${mac_build}" ]; then 
    rm -rf ${mac_build}
fi

mkdir -p ${mac_build}
cd ${mac_build}


# cmake -j`sysctl -n hw.logicalcpu` .. -G Xcode -DPLATFORM=Mac
cmake .. -G Xcode -DPLATFORM=Mac

# cmake --build . -j`sysctl -n hw.logicalcpu` --config Debug
cmake --build . --config Debug

cmake --install . --prefix "${mac_build}/librtmp" --config Debug
